import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
	{
		path:'/',
		redirect:'/login'
	},
    {
        path: '/login',
        name: 'Login',
        component: () => import('../views/login')
    },
    {
        path: '/default',
        name: 'Default',
        component: () => import('../views/default'),
        children: [
			{path:'/',redirect:'apexmic'},
            {path: 'area', component: () => import('../views/components/area')},
            {path: 'bill', component: () => import('../views/components/bill')},
            {path: 'customer', component: () => import('../views/components/customer')},
            {path: 'license', component: () => import('../views/components/license')},
            {path: 'park', component: () => import('../views/components/park')},
            {path: 'parkPoint', component: () => import('../views/components/parkpoint')},
            {path: 'settle', component: () => import('../views/components/settle')},
            {path: 'apexmic', component: () => import('../views/components/Apexmic')},
            {path: 'adminSetting', component: () => import('../views/components/adminSetting')},
            {path: 'dataView', component: () => import('../views/components/dataview')},
            {path: 'oSSInfo', component: () => import('../views/components/ossInfo')},
            {path: 'payInfo', component: () => import('../views/components/payInfo')},
            {path: 'report', component: () => import('../views/components/report')}
        ]
    }
]


const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes,

})

export default router

// const originalPush = VueRouter.prototype.push
// VueRouter.prototype.push = function push(location) {
//     return originalPush.call(this, location).catch(err => err)
// }

